package com.nmgydy.beans;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;

public class ProgressBean {
	
	private String status;
	private int percent;
	private List<ProgressDetailBean> details;
	
	/** 未处理 */
	public static String STATUS_UNPROCESSED = "unprocessed";
	/** 处理中 */
	public static String STATUS_PROCESSING = "processing";
	/** 处理成功 */
	public static String STATUS_SUCCESS = "success";
	/** 处理失败 */
	public static String STATUS_FAILD = "faild";
	
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public int getPercent() {
		return percent;
	}
	public void setPercent(int percent) {
		this.percent = percent;
	}
	public List<ProgressDetailBean> getDetails() {
		return details;
	}
	public void setDetails(List<ProgressDetailBean> details) {
		this.details = details;
	}
	
	public static void main(String[] args) {
		ProgressBean bean = new ProgressBean();
		bean.setStatus(ProgressBean.STATUS_UNPROCESSED);
		bean.setPercent(50);
		List<ProgressDetailBean> details = new ArrayList<ProgressDetailBean>();
		details.add(new ProgressDetailBean("班级数据同步",ProgressBean.STATUS_SUCCESS));
		details.add(new ProgressDetailBean("学生数据同步",ProgressBean.STATUS_PROCESSING));
		details.add(new ProgressDetailBean("注册费生成",ProgressBean.STATUS_FAILD));
		bean.setDetails(details);
		System.out.println(JSON.toJSONString(ResultBean.success(bean),true));
	}
	
}
